#!/bin/sh
#VERSION 2
#edited by MQ 3/13/2013
#THIS SCRIPT CONNECTS TO THE CARB SERVER
FTPLOG="ftplog"
SUCCESS="226"
PASSWD='mvona@arb.ca.gov'
USER='anonymous'
full_file="$1"
#only_file=$(echo $full_file | awk -F'/' '{print $NF}')
cp $full_file . 1> /dev/null 2> /dev/null
timeout 60 ftp -niv ftp.arb.ca.gov<<EOF 1> $FTPLOG 2> /dev/null
user $USER $PASSWD
binary
passive
cd pub
cd incoming
put $1
bye
EOF
if fgrep "$SUCCESS" $FTPLOG; then
	rm -f $1 1> /dev/null 2> /dev/null
fi
